package com.example.bzh.gamecat.ui.society.allsociety;

import com.example.bzh.gamecat.bean.AllSocietyBean;
import com.example.bzh.gamecat.httputils.societyutils.AllSocietyHttpUtil;

import java.util.HashMap;

/**
 * Created by MyPC on 2016/8/16.
 */
public class AllSocietyPresenter implements AllSocietyContract.IPresenter {

    private AllSocietyContract.IModel iModel;
    private AllSocietyContract.IView iView;

    public AllSocietyPresenter(AllSocietyContract.IView iView,AllSocietyContract.IModel iModel){
        this.iView = iView;
        this.iModel = iModel;
    }

    @Override
    public void initData(HashMap<String, String> params) {
        iModel.getAllSociety(params, new AllSocietyHttpUtil.HttpCallBack<AllSocietyBean>() {
            @Override
            public void onSucess(AllSocietyBean allSocietyBean) {
                iView.OnSeccessAllSociety(allSocietyBean);
            }

            @Override
            public void onFail() {
                iView.OnFailAllSociety("数据加载失败......");
            }
        });
    }
}
